import Vue from 'vue';
import VueRouter from 'vue-router';
import login from '../views/login.vue';
import Layout from '@/Layout';

Vue.use(VueRouter)

const routes = [{
    path: '/login',
    name: 'about',
    component: login
  },
  {
    path: '/',
    redirect: "/login",
  },
  {
    path: '/home',
    component: Layout,
    redirect: "/home/streaming",
    meta: {
      toPath: '/streaming',
      noCache: true
    },
    children: [{
        // 直播事件
        path: 'streaming',
        name: 'streaming',
        component: () => import('@/views/listMeau/streaming/index'),
        meta: {
          title: '直播事件',
          toPath: '/listMeau/streaming',
        }
      },
      {
        // 功能列表
        path: 'function',
        name: 'function',
        component: () => import('@/views/listMeau/function/index'),
        meta: {
          title: '功能列表',
          toPath: '/listMeau/function',
        }
      },
      {
        // 功能列表
        path: 'setup',
        name: 'setup',
        component: () => import('@/views/listMeau/setup/index'),
        meta: {
          title: '功能列表',
          toPath: '/listMeau/setup',
        }
      },
      {
        //  插件列表
        path: 'chaJian',
        name: 'chaJian',
        component: () => import('@/views/listMeau/chaJian/index'),
        meta: {
          title: '插件列表',
          toPath: '/listMeau/chaJian',
        }
      },

    ],
  },
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router